<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录页面</title>
</head>
<body>

<form action="login.action" method="get" onsubmit="return check();"><%--ture：跳转  false：不跳转--%>

    账号：<input type="text" name="username" id="username"><br>

    密码：<input type="password" name="password" id="password"><br>

    <input type="submit" value= "登录">

    <a href="toRegister.action">注册</a>

    <a href="reset.jsp">修改密码</a>

</form>
<script type="text/javascript">
    //进行数据验证
    function check() {
        //获取用户名
        var name=$("#username").val();
        var  pass=$("#password").val();
        if (name == null || name == ""){
            alert("账户不能为空");
            return false;
        }
        if (pass==null||pass==""){
            alert("密码不能为空")
            return false;
        }
        return  true;
    }
</script>
</body>
</html>